package com.guigu.liuzhireng.controller;

import com.guigu.liuzhireng.pojo.Account;
import com.guigu.liuzhireng.pojo.AccountRoleMenu;
import com.guigu.liuzhireng.service.AccountRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@RequestMapping("AccountRoleMenu.do")
public class AccountRoleMenuController {

    @Autowired
    AccountRoleMenuService accountRoleMenuService;

    @RequestMapping("QueryIndex")
    public List<AccountRoleMenu> QueryIndex(HttpSession session){
        Account user = (Account) session.getAttribute("user");
        // 菜单栏
        List<AccountRoleMenu> list = accountRoleMenuService.QueryIndex(user.getAccount());
        return list;
    }


}
